<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CrateShopProductSpecsTable extends Migration
{
    public function up()
    {
        //产品规格
        Schema::create('shop_product_specs', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('product_id')->comment('产品ID');
            $table->string('spec')->comment('规格');
            $table->unsignedDecimal('price',10,2)->comment('价格');
            $table->integer('stock')->comment('库存数量');
            $table->decimal('weight',10,3)->default(0)->comment('重量  默认 0kg');
            $table->tinyInteger('sort')->default(50)->comment('排序');
            $table->timestamps();
        });
    }
    public function down()
    {
        Schema::dropIfExists('shop_product_specs');
    }
}
